import { useLocation } from '@umijs/max';
import { parse } from 'query-string';

/**
 * 
 * @returns 路由上search对象
 */
export const useSearchParams = () => {
  const { search } = useLocation();
  const res = parse(search);
  return res;
};

export default useSearchParams;
